<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>ApplicationShell.mxml</title>
<link rel="stylesheet" type="text/css" href="../SourceStyles.css"/>
</head>

<body><pre><span class="mxmlCdata">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</span>
<span class="mxmlComponent">&lt;mx:Application</span> implements=&quot;<span class="mxmlString">appCoreLib.core.IApplicationShell</span>&quot;
    viewSourceURL=&quot;<span class="mxmlString">srcview/index.html</span>&quot;
    
    layout=&quot;<span class="mxmlString">vertical</span>&quot;
    
    creationComplete=&quot;onCreationComplete<span class="asBracket">()</span>;&quot;
    
    xmlns:mx=&quot;<span class="mxmlString">http://www.adobe.com/2006/mxml</span>&quot; 
    xmlns:appCoreLib=&quot;<span class="mxmlString">http://www.appCoreLib.com/2007/mxml</span>&quot;<span class="mxmlComponent">&gt;</span>
    
    <span class="mxmlTag">&lt;mx:Script&gt;</span>
        <span class="asOperator">&lt;!</span><span class="asBracket">[</span>CDATA<span class="asBracket">[</span>
            <span class="asReserved">import</span> appCoreLib.events.XMLLoadEvent;
            
            <span class="asReserved">import</span> mx.controls.Text;
            <span class="asReserved">import</span> mx.controls.Alert;
            
            <span class="asReserved">private</span> <span class="asFunction">function</span> onCreationComplete <span class="asBracket">()</span><span class="asOperator">:</span><span class="asReserved">void</span>
            <span class="asBracket">{</span>
                content.loadXML<span class="asBracket">()</span>;
                settings.loadXML<span class="asBracket">()</span>;
            <span class="asBracket">}</span>
            
            <span class="asReserved">private</span> <span class="asFunction">function</span> onXMLLoadSuccess <span class="asBracket">()</span><span class="asOperator">:</span><span class="asReserved">void</span>
            <span class="asBracket">{</span>
                <span class="asReserved">if</span> <span class="asBracket">(</span>content.isLoaded <span class="asOperator">&amp;&amp;</span> settings.isLoaded<span class="asBracket">)</span>
                    shellInitialized<span class="asBracket">()</span>;
            <span class="asBracket">}</span>
            
            <span class="asReserved">private</span> <span class="asFunction">function</span> onXMLLoadFailure <span class="asBracket">(</span>evt<span class="asOperator">:</span>XMLLoadEvent<span class="asBracket">)</span><span class="asOperator">:</span><span class="asReserved">void</span>
            <span class="asBracket">{</span>
                Alert.show<span class="asBracket">(</span><span class="asString">&quot;failed to load &quot;</span> <span class="asOperator">+</span> evt.target.source <span class="asOperator">+</span> <span class="asString">&quot;.  Please try again later&quot;</span>, <span class="asString">&quot;XML Load Failure&quot;</span><span class="asBracket">)</span>;
            <span class="asBracket">}</span>
            
            <span class="asReserved">public</span> <span class="asFunction">function</span> shellInitialized <span class="asBracket">()</span><span class="asOperator">:</span><span class="asReserved">void</span>
            <span class="asBracket">{</span>
                <span class="asVar">var</span> s<span class="asOperator">:</span>String <span class="asOperator">=</span> content.getStringValue<span class="asBracket">(</span><span class="asString">&quot;test&quot;</span><span class="asBracket">)</span>;
                
                <span class="asVar">var</span> lbl<span class="asOperator">:</span>Text <span class="asOperator">=</span> <span class="asReserved">new</span> Text<span class="asBracket">()</span>;
                lbl.width <span class="asOperator">=</span> 300;
                lbl.height <span class="asOperator">=</span> 300;
                lbl.htmlText <span class="asOperator">=</span> s;
                
                addChild<span class="asBracket">(</span>lbl<span class="asBracket">)</span>;
            <span class="asBracket">}</span>
            
        <span class="asBracket">]]</span><span class="asOperator">&gt;</span>
    <span class="mxmlTag">&lt;/mx:Script&gt;</span>
    
    <span class="mxmlComponent">&lt;appCoreLib:Content</span> id=&quot;<span class="mxmlString">content</span>&quot; source=&quot;<span class="mxmlString">xml/content.xml</span>&quot; xmlLoadSuccess=&quot;onXMLLoadSuccess<span class="asBracket">()</span>;&quot; xmlLoadFailure=&quot;onXMLLoadFailure<span class="asBracket">(</span>event<span class="asBracket">)</span>;&quot;<span class="mxmlComponent">/&gt;</span>
    <span class="mxmlComponent">&lt;appCoreLib:Settings</span> id=&quot;<span class="mxmlString">settings</span>&quot; source=&quot;<span class="mxmlString">xml/content.xml</span>&quot; xmlLoadSuccess=&quot;onXMLLoadSuccess<span class="asBracket">()</span>;&quot; xmlLoadFailure=&quot;onXMLLoadFailure<span class="asBracket">(</span>event<span class="asBracket">)</span>;&quot;<span class="mxmlComponent">/&gt;</span>
    
<span class="mxmlComponent">&lt;/mx:Application&gt;</span></pre></body>
</html>
